import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
//确认订单
import { ConfirmOrderPage } from '../confirm-order/confirm-order';
/**
 * Generated class for the GoodsInfoPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-goods-info',
  templateUrl: 'goods-info.html',
})
export class GoodsInfoPage {
	pet = "kittens";
	stock: number = 1;
	goodsPrice: number;
	goodsId: string;
	goodsImg: string
	buyName: string
	goodsName:string
	quanjia: string
	huanmai_rate: string
	goods_info_type: string
	constructor(public navCtrl: NavController, public navParams: NavParams) {
		this.stock = this.navParams.get('num');
		this.goodsPrice = this.navParams.get('price');
		this.goodsId = this.navParams.get('id');
		this.goodsImg = this.navParams.get('img');
		this.buyName = this.navParams.get('buyname'); 
		this.goodsName = this.navParams.get('goodsname'); 
		this.quanjia = this.navParams.get("quanjia"); 
		this.huanmai_rate = this.navParams.get("huanmai_rate"); 
		this.goods_info_type = this.navParams.get("goods_info_type"); 
	}

	ionViewDidLoad() {
		console.log('ionViewDidLoad GoodsInfoPage');
	}
	
	confirm(){
		this.navCtrl.push(ConfirmOrderPage, {
			"num": this.stock,
			"price": this.goodsPrice,
			"id": this.goodsId,
			"img": this.goodsImg,
			"buyname": this.buyName,
			"goodsname": this.goodsName,
			"zhuanmai_rate": this.huanmai_rate,
		})
	}

}
